@keyframes modal-slide-in {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card-detail-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    overflow-y: auto;
    padding: 20px;

    .card-detail-modal {
        background-color: #fff;
        border-radius: 8px;
        width: 100%;
        max-width: 768px;
        max-height: 90vh;
        overflow-y: auto;
        box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
        display: flex;
        flex-direction: column;
        animation: modal-slide-in 0.3s ease-out;

        .card-detail-header {
            padding: 32px 32px 20px;
            position: relative;

            .card-detail-title {
                font-size: 24px;
                font-weight: bold;
                margin-bottom: 10px;
                cursor: pointer;
                color: var(--nb-default-color);
                &:hover {
                    background-color: rgba(0, 0, 0, 0.05);
                    border-radius: 4px;
                }
            }

            .title-input {
                width: 100%;
                font-size: 24px;
                font-weight: bold;
                padding: 8px;
                border: 2px solid var(--nd-color-primary);
                border-radius: 4px;
                margin-bottom: 10px;
                box-sizing: border-box;

                &:focus {
                    outline: none;
                }
            }

            .created-time {
                font-size: 14px;
                color: var(--nb-default-color);
            }

            .close-button {
                position: absolute;
                top: 0;
                right: 0;
                font-size: 24px;
                background: none;
                border: none;
                cursor: pointer;
                color: var(--nb-default-color);

                &:hover {
                    color: rgba(var(--nb-default-color-rgb), .8);
                }
            }
        }

        .card-detail-content-container {
            display: flex;
            padding: 0 20px 0 32px;
            .left-container {
                flex: 1;
                .card-detail-content,
                .card-detail-checklists {
                    margin-top: 25px;
                    .section-header {
                        display: flex;
                        justify-content: space-between;
                        align-items: center;
                        margin-bottom: 20px;
                        color: var(--nb-default-color);
                        h3 {
                            font-size: 18px;
                            font-weight: 600;
                        }
                    }

                    .save-button,
                    .add-button {
                        padding: 8px 16px;
                    }
                }

                .card-detail-content {
                    .edit-button {
                        padding: 6px 12px;
                        background-color: #f0f2f5;
                        border: none;
                        border-radius: 4px;
                        cursor: pointer;

                        &:hover {
                            background-color: #e4e6e9;
                        }
                    }

                    .content-display {
                        min-height: 60px;
                        padding: 10px;
                        border-radius: 4px;
                        border: 1px solid #e1e4e8;
                        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
                        transition: all 0.2s ease;
                        color: #2c3e50;
                        &:hover {
                            background-color: rgba(0, 0, 0, 0.02);
                            box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
                        }

                        .empty-content {
                            color: rgba(var(--nb-default-color-rgb), .8);
                            font-style: italic;
                        }
                    }

                    .content-textarea {
                        width: 100%;
                        padding: 10px;
                        border: 2px solid var(--nd-color-primary);
                        border-radius: 4px;
                        resize: vertical;
                        font-family: inherit;
                        box-sizing: border-box;

                        &:focus {
                            outline: none;
                        }
                    }

                    .edit-actions {
                        display: flex;
                        gap: 10px;
                        margin-top: 10px;
                    }
                }

                /* 待办事项列表部分 */
                .card-detail-checklists {
                    border-bottom: 1px solid #e1e4e8;
                    .add-checklist-button {
                        padding: 6px 12px;
                        border-radius: 4px;
                    }
                    .add-checklist-form {
                        margin-bottom: 20px;
                        background-color: #f8f9fa;
                        padding: 15px;
                        border-radius: 6px;

                        input {
                            width: 100%;
                            padding: 8px 12px;
                            border: 1px solid #ced4da;
                            border-radius: 4px;
                            margin-bottom: 10px;
                            box-sizing: border-box;

                            &:focus {
                                outline: none;
                                border-color: var(--nd-color-primary);
                            }
                        }
                    }
                    .checklist-container {
                        background-color: #fff;
                        border-radius: 8px;
                        padding: 18px;
                        margin-bottom: 20px;
                        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
                        border: 1px solid #e1e4e8;
                        transition: box-shadow 0.2s ease;

                        &:hover {
                            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
                        }
                        .checklist-header {
                            display: flex;
                            justify-content: space-between;
                            align-items: center;
                            margin-bottom: 15px;

                            h4 {
                                font-size: 16px;
                                font-weight: 600;
                                margin: 0;
                            }

                            .progress-indicator {
                                display: flex;
                                align-items: center;

                                .delete-button {
                                    margin-left: 14px;
                                    padding: 0;
                                    width: 24px;
                                    height: 24px;
                                    display: flex;
                                    align-items: center;
                                    justify-content: center;
                                }
                            }
                        }
                        .checklist-items {
                            margin: 0;
                            padding: 8px 0;
                            list-style: none;
                            border-radius: 6px;
                            .checklist-item {
                                display: flex;
                                align-items: center;
                                padding: 8px;
                                transition: background-color 0.2s;
                                line-height: 20px;
                                font-size: 14px;
                                color: rgba(0, 0, 0, 0.8);
                                border-radius: 8px;
                                &:last-child {  
                                    border-bottom: none;
                                }
                                
                                &:hover {
                                    background-color: #f0f2f5;
                                }
                                .title{
                                    flex: 1;
                                    .completed {
                                        text-decoration: line-through;
                                        color: var(--nb-default-color);
                                        font-style: italic;
                                    }
                                }
                                .delete-btn-icon{
                                    cursor: pointer;
                                    font-size: 16px;
                                    width: 24px;
                                    height: 24px;
                                    line-height: 24px;
                                    text-align: center;
                                    opacity: 0;
                                }
                                &:hover{
                                    .delete-btn-icon {
                                        opacity: 1;
                                    }
                                }
                            }
                        }
                        .add-check-btn{
                            margin-top: 15px;
                            width: 30%;
                        }
                    }
                }
            }
            .right-container{
                width: 120px;
                padding-left: 25px;
                .btn{
                    width: 120px;
                }
            }
        }

    }
}

.cancel-button {
    padding: 8px 16px;
    background-color: #f0f2f5;
    border: none;
    border-radius: 4px;
    cursor: pointer;

    &:hover {
        background-color: #e4e6e9;
    }
}

.progress-indicator {
    font-size: 14px;
    color: var(--nb-default-color);
}

.progress-bar {
    height: 8px;
    background-color: #e9ecef;
    border-radius: 4px;
    margin-bottom: 15px;

    .progress {
        height: 100%;
        background-color: var(--nd-color-success);
        border-radius: 4px;
        transition: width 0.3s ease;
    }
}

.checkbox-container {
    display: flex;
    align-items: center;
    position: relative;
    margin-right: 15px;
    cursor: pointer;

    input {
        position: absolute;
        opacity: 0;
        cursor: pointer;
        height: 0;
        width: 0;
    }

    .checkmark {
        position: relative;
        height: 20px;
        width: 20px;
        background-color: #f0f2f5;
        border-radius: 4px;

        &:after {
            content: "";
            position: absolute;
            display: none;
            left: 7px;
            top: 3px;
            width: 5px;
            height: 10px;
            border: solid #fff;
            border-width: 0 2px 2px 0;
            transform: rotate(45deg);
        }
    }

    input:checked~.checkmark {
        background-color: var(--nd-color-success);
    }

    input:checked~.checkmark:after {
        display: block;
    }
}

.add-checklist-item {
    
    input {
        width: 100%;
        padding: 8px 12px;
        border: 1px solid #ced4da;
        border-radius: 4px;
        box-sizing: border-box;
        &:focus {
            outline: none;
            border-color: var(--nd-color-primary);
        }
    }
    .btns{
        margin-top: 10px;
        display: flex;
        gap: 10px;
        .cancel-button{
            width: 100%;
        }
        
    }
}